package com.ifonly.ar.core;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ifonly
 * @version 1.0 2015-12-03 21:03
 * @since JDK 1.6
 */
class ARTableMapper {

    private static Map<Class<? extends ARModel>, Table> arTableMappers = new HashMap<Class<? extends ARModel>, Table>();

    private ARTableMapper() {}

    private static class InstanceHolder {
        private static ARTableMapper instance = new ARTableMapper();
    }

    public static ARTableMapper getInstance() {
        return InstanceHolder.instance;
    }

    public void set(Class<? extends ARModel> arModel, Table table) {
        arTableMappers.put(arModel, table);
    }

    public Table get(Class<? extends ARModel> arModel) {
        return arTableMappers.get(arModel);
    }

}
